package com.nine.dao;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import com.nine.bean.NoticeBean;
import com.nine.utils.JdbcUtil;
public class NoticeDao {

		public List<NoticeBean> listNotice() {
			List<NoticeBean> noticeList = new ArrayList<NoticeBean>();
			Connection conn = null;
			Statement stmt = null;
			ResultSet rs = null;
			String sql = null;
			try {
				sql = "Select * From t_notice order by id asc";
		
			
				noticeList = JdbcUtil.executeQueryT(sql, NoticeBean.class);
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				//JdbcUtil.closeResource(rs, stmt, conn);
			}
			return noticeList;
		}

		public void saveNotice(NoticeBean noticeBean) {

		}

		public boolean existNotice(String notice) {
			// TODO Auto-generated method stub
			return false;
		}

		public boolean deleteNoticeById(String id) {
			String sql = "Delete From t_notice where id = " + id + "";
			try {
				return JdbcUtil.executeDML(sql);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return false;
		}

	}

